home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 079c.dms / 079c.adf / how2writeagame.lha / how2write_a_game / bob_grabber.AMOS / bob_grabber.amosSourceCode
AMOS Source Code  |  1992-03-06  |  3KB  |  140 lines

  1. ' *************************************************************
  2. '
  3. '                          =========== 
  4. '
  5. '                          BOB GRABBER 
  6. '
  7. '                          =========== 
  8. '
  9. '                       /\/\/\/\/\/\/\/\/\   
  10. '                       By: Paul Nordovics   
  11. '                       \/\/\/\/\/\/\/\/\/   
  12. '  
  13. ' Notes: 
  14. ' ====== 
  15. '
  16. ' Feel Free To Use This For Whatever, But Don't Pass It Off As 
  17. ' Your Own Work! 
  18. '
  19. ' *************************************************************
  20. '
  21. Paper 0
  22. '
  23. ' ******************** 
  24. ' Remove Mouse Pointer 
  25. ' ******************** 
  26. Hide 
  27. '
  28. _START:
  29. '
  30. ' ***********************
  31. ' Clear Bank 1 = Bob Bank
  32. ' ***********************
  33. Erase 1
  34. '
  35. ' **************************************** 
  36. ' Get User To Enter Details Regarding Bobs 
  37. ' **************************************** 
  38. Repeat 
  39.    Cls 0
  40.    K$="n"
  41.    Locate 0,0
  42.    Input "HOW MANY BOBS DO YOU WISH TO MAKE? ";_BOB_NUMBER
  43.    Input "BOB WIDTH (IN PIXELS)? ";_BOB_WIDTH
  44.    Input "BOB HEIGHT (IN PIXELS)? ";_BOB_HEIGHT
  45.    '
  46.    Print 
  47.    Print "BOBS TO CUT=";_BOB_NUMBER
  48.    Print "BOB WIDTH  =";_BOB_WIDTH
  49.    Print "BOB HEIGHT =";_BOB_HEIGHT
  50.    Print 
  51.    Input "IS THIS CORRECT? (y/n) ";K$
  52. Until K$="y"
  53. '
  54. Curs Off 
  55. '
  56. ' ****************** 
  57. ' Show Mouse Pointer 
  58. ' ****************** 
  59. Show 
  60. '  
  61. ' ***************************************
  62. ' Get IFF Picture Via AMOS File Requester
  63. ' ***************************************
  64. F$=Fsel$("*.iff","","Pick an IFF picture")
  65. '
  66. ' ******************** 
  67. ' Remove Mouse Pointer 
  68. ' ******************** 
  69. Hide 
  70. '
  71. ' *****************************************
  72. ' Return To AMOS Editor If Nothing Selected
  73. ' *****************************************
  74. If F$="" Then Edit 
  75. '
  76. ' ************************** 
  77. ' Load Picture Into Screen 0 
  78. ' ************************** 
  79. Load Iff F$,0
  80. '
  81. ' *************************
  82. ' Cut Bobs From IFF Picture
  83. ' *************************
  84. X=0 : Y=0 : N=1
  85. Repeat 
  86.    Get Bob N,X,Y To X+_BOB_WIDTH,Y+_BOB_HEIGHT
  87.    Add X,_BOB_WIDTH
  88.    If X>319
  89.       X=0
  90.       Add Y,_BOB_HEIGHT
  91.    End If 
  92.    Add N,1
  93.    Add _BOB_NUMBER,-1
  94. Until _BOB_NUMBER=0
  95. '
  96. ' ****************** 
  97. ' Show Mouse Pointer 
  98. ' ****************** 
  99. Show 
  100. '
  101. ' *************************************
  102. ' Save Bob File Via AMOS File Requester
  103. ' *************************************
  104. F$=Fsel$("*.abk","","Save Bobs As")
  105. '
  106. ' ******************** 
  107. ' Remove Mouse Pointer 
  108. ' ******************** 
  109. Hide 
  110. '
  111. If F$="" Then Edit 
  112. '
  113. Save F$,1
  114. '
  115. ' *****************************************
  116. ' Give Enough Time For Disk Buffer To Empty
  117. ' *****************************************
  118. Wait 150
  119. '
  120. ' ******************************** 
  121. ' Change Colours 1 and 3 To White
  122. ' 1=Text Colour, 3=Cursor Colour 
  123. ' ******************************** 
  124. Colour 1,$FFF : Colour 3,$FFF
  125. '
  126. Cls 0 : Pen 1 : Paper 0
  127. '
  128. ' ***********************************
  129. ' Ask If User Wants To Make More Bobs
  130. ' ***********************************
  131. Locate 0,0
  132. Input "DO YOU WANT TO MAKE MORE BOBS? (y/n) ";K$
  133. If K$="y"
  134.    Goto _START
  135. Else 
  136.    Edit 
  137. End If 
  138. '
  139. ' -------------------------------------------------------------
  140. '